#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "../umlcore/JsonSerializable.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Element;

/// <summary>
/// Comment
/// A Comment is a textual annotation that can be attached to a set of Elements.
/// </summary>
class UMLMODEL_EXPORT Comment : public JsonSerializable {

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// annotatedElements getter
    /// References the Element(s) being commented.
    /// </summary>
    vector<shared_ptr<Element>>& annotatedElements();

    /// <summary>
    /// body getter
    /// Specifies a string that is the comment.
    /// </summary>
    QString body() const;

    /// <summary>
    /// body setter
    /// Specifies a string that is the comment.
    /// </summary>
    void setBody(const QString& value);

private: // Fields
    /// <summary>
    /// annotatedElements
    /// References the Element(s) being commented.
    /// </summary>
    vector<shared_ptr<Element>> annotatedElements_;

    /// <summary>
    /// body
    /// Specifies a string that is the comment.
    /// </summary>
    const static QString body_default_;
    QString body_= body_default_;

};

} // namespace uml
